<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>]
    <%@include file="/taglibs.jsp"%>
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">  
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="${ctx}/resources/semanticui/semantic.min.css" rel="stylesheet" type="text/css" />
    <link href="${ctx}/resources/apps.css" rel="stylesheet" type="text/css" />
    <title>HR公司信息</title>  
</head>
<body>
<div class="ui segment" id="n-page">
&nbsp;<br>
我们需要对你提交的公司信息进行认证。&nbsp;<br>&nbsp;<br>
您必须提交公司的营业执照。&nbsp;<br>&nbsp;<br>
    <form class="ui form"  action="${ctx}/wechat/company/uploadFile.do"  enctype="multipart/form-data" method="post" >
        <!-- div class="field">
            <label>您可以在这里上传公司营业执照</label>
            <div class="ui input">
                <input type="file" name="bizcodephoto" id="bizcodephoto" placeholder="请选择要上传的公司营业执照">
            </div>
        </div> -->
        <div class="z_photo upimg-div clear" >
   			 <section class="z_file fl">
   			 	<c:if test="${employer.imageUrl!=null}">
   			 		<img class=" floated mini ui image" id="miniImg" src="${employer.image}">
   			 	</c:if>
   			 	<c:if test="${employer.imageUrl==null}">
					<img src="${ctx}/resources/imgup/img/a11.png" class="add-img">
					<input type="file" name="file" id="file" class="file" value="${employer.image}" accept="image/jpg,image/jpeg,image/png,image/bmp"  />
				</c:if>
			</section>
    	</div>
        <input type="hidden" name="hrId" id="hrId" value="${employer.id}"/>
        <input type="hidden" name="companyId" id="companyId" value="${employer.companyId}"/>
        <button class="fluid ui button" type="submit" style="paddint-top:10px;">下一步</button>
    </form>
<%--     <c:choose>
		<c:when test="${hr.imgUrl != null }">
			<img class=" floated  ui image" id="miniImg" src="${hr.imgUrl}">
		</c:when> 
		<c:otherwise>
			<img class=" floated  ui image" id="miniImg"  src="">
		</c:otherwise>
	</c:choose> --%>
</div>
<!-- <div class="ui segment" id="btn-next">
    <div class="fluid ui button" id="next">上传营业执照</div>
</div> -->
<!--
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
-->
<script src="${ctx}/resources/jweixin-1.0.0.js"></script>
<script src="${ctx}/resources/semanticui/jquery-2.1.4.min.js"></script>
<script src="${ctx}/resources/semanticui/semantic.js" type="text/javascript"></script>
<script src="${ctx}/resources/imgup/js/imgUp.js"></script>
<script type="text/javascript">

      wx.config({
        debug: false, 
        appId: "${config.appid}",  
        timestamp: ${config.currenttimestamp},  
        nonceStr: "${config.nonceStr}", 
        signature: "${config.signatureStr}", 
        jsApiList: ['checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'closeWindow']  
    });

    var url = '${ctx}/wechat/company/uploadFile.do';
    var handler = { 
        activate: function() { 
            $(this).addClass('active').siblings().removeClass('active'); 

            if($(this).attr('id') == 'next') {
                $(this).addClass('disabled');
        /*         wx.chooseImage({
                    count: 1,
                    success: function (res) {
                        var localId = res.localIds[0];
                        wx.uploadImage({ 
                            localId: localId,  
                            isShowProgressTips: 1,  
                            success: function (res) { 
                                var serverId = res.serverId;
                             imgUrl=res.serverId;
                                $("#miniImg").attr("src",serverId);
                                wx.downloadImage({
                                	serverId: res.serverId, // 需要下载的图片的服务器端ID，由uploadImage接口获得
                                	isShowProgressTips: 1, // 默认为1，显示进度提示
                                	success: function (res) {
                                		var localId = res.localId; // 返回图片下载后的本地ID
                                		//获取本地图片接口
                                		wx.getLocalImgData({
                                			 localId: localId, // 图片的localID
                                			 success: function (res) {
                                				 var localData = res.localData; // localData是图片的base64数据，可以用img标签显示
                                			 }
                                		});
                                	}
                                });
                                var compId = $('#companyId').val();
                                url += "?companyId=" + compId;
                                url += "&hrId=" + $('#hrId').val();
                                url += "&resId=" + serverId;
                                location.href = url;
                            } 
                        });
                    }
                }); */
            }
        } 
    };
    
    $(document).ready(function() {
        wx.ready(function() {
            $('.button').on('click', handler.activate);
        });

    });

</script>
</body>
</html>